import request from '@/utils/http'
import { question } from './globals'

export function login(data) {
  return request({
    url: `${question}/login/in?username=${data.username}&password=${data.password}`,
    method: 'post',
    data
  })
}

//题目新增
export function addTitle(data) {
  return request({
    url: `${question}/add`,
    method: 'post',
    data
  })
}
//题目修改
export function editTitle(data) {
  return request({
    url: `${question}/update`,
    method: 'post',
    data
  })
}

//题目列表
export function getTitleList(params) {
  return request({
    url: `${question}/list`,
    method: 'get',
    params
  })
}

//题目删除
export function deleteTitle(questionId) {
  return request({
    url: `${question}/del?questionId=${questionId}`,
    method: 'delete'
  })
}
